<template>
       <div class="staff-list_box">
           <checkbox-group @change="checkItem">
            <div class="staff-list"
                    v-for="(item,index) in list"
                @click="toDetail(item)"
                :key="index"
                >
                <checkbox :check="item.check" color="#ffd11a" v-if="check == 'true'"/>
                <!-- <van-checkbox checked-color="#ffd11a" v-model="item.check" @click="checkItem(item.check,index)" v-if="check"/> -->
                <img :src="item.user_picture" alt="">
                <div class="staff-list_right">
                    <h3>{{item.name}}</h3>
                    <div>职位：{{item.job}}</div>
                    <div>部门：{{item.department_name}}</div>
                    <div>电话：{{item.mobile_phone}}</div>
                </div>
                <div class="staff-status">
                    <img v-if="item.status===1" class="staff-status" :src="imgUrl+'publicicon/icon_memconcle.png'" alt="">
                    <img v-if="item.status===2" class="staff-status" :src="imgUrl+'publicicon/icon_memconfirm.png'" alt="">
                    <img v-if="item.status===3" class="staff-status" :src="imgUrl+'publicicon/icon_memquit.png'" alt="">
                    <img v-if="item.status===4" class="staff-status" :src="imgUrl+'publicicon/icon_dimission.png'" alt="">
                </div>
            </div>
            </checkbox-group>
        </div>
</template>

<script>
export default {
	name: 'staff-list',
	props: {
		list: {
			type: Array,
			default: () => []
		},
		check: {
			type: String,
			default: 'true'
		}
	},
	data() {
		return {
			imgUrl: this.$constant.imgUrl
		}
	},
	methods: {
		checkItem(e) {
			console.log(e, '单选项变化')
			//   this.$emit('checkItem', { check, index })
		},
		toDetail(item) {
			if (this.check == 'false') {
				const params = {
					relation_user_id: item.relation_user_id,
				    user_id: item.relation_user_id
				}
				uni.navigateTo({
					url: `/pages/admin/staffManage/staffDetail${this.commonJS.queryData(params)}`
				})
			}
		}
	}
}
</script>

<style scoped lang="scss">
    .staff-list_box {
        padding: 0 30px;
        .staff-list {
            padding: 30px 20px;
            background-color: #FFFFFF;
            display: flex;
            align-items: center;
            box-shadow:0px 1px 6px 0px rgba(221,221,221,0.5);
            border-radius:20px;
            margin-top: 20px;
            overflow: hidden;
            position: relative;
            & > img {
                width: 120px;
                height: 120px;
                border-radius: 50%;
                margin-left: 20px;
                border:0.5rpx solid #ddd;
            }
            & .staff-list_right {
                flex: 1;
                padding-left:40px;
                & > h3 {
                    color: #333333;
                    font-weight: 600;
                    font-size: 34px;
                    margin-bottom: 20px;
                }
                & > div {
                    color: #666666;
                    font-weight: 400;
                    font-size: 24px;
                    line-height: 30px;
                }
            }
            & .staff-status {
                position: absolute;
                right: 0;
                top: 0;
                width: 90px;
                height: 90px;
                & > img{
                    width: 100%;
                    height: 100%;
                }
            }

        }
    }
</style>
